home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Software Contest 3
/
FM Towns Software Contest 3.iso
/
exp
/
astral
/
a1
/
game
/
source
/
sinout.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-07
|
610b
|
32 lines
#include <stdio.h>
#include <math.h>
void main(void)
{
double i,w;
printf("#ifdef MAIN\n");
printf("int sin_data[256]={\n");
for(i=0;i<255;i++){
w=sin(i/128*PI)*128;
printf(" %3d,\n",(int)(w));
}
w=sin((double)(255)/128*PI)*128;
printf(" %3d\n};\n",(int)(w));
printf("int cos_data[256]={\n");
for(i=0;i<255;i++){
w=cos(i/128*PI)*128;
printf(" %3d,\n",(int)(w));
}
w=cos((double)(255)/128*PI)*128;
printf(" %3d\n};\n",(int)(w));
printf("#else\n");
printf("extern int sin_data[256];\n");
printf("extern int cos_data[256];\n");
printf("#endif");
}